package com.jintian.smart.base.api.message.entity;

import com.jintian.smart.base.api.message.constant.MessageTypeEnum;
import com.jintian.smart.kernel.core.domain.IEntity;
import com.jintian.smart.kernel.core.enumeration.UserTypeEnum;
import lombok.Data;
import org.beetl.sql.annotation.builder.FillStrategy;
import org.beetl.sql.annotation.builder.UpdateTime;
import org.beetl.sql.annotation.entity.AssignID;
import org.beetl.sql.annotation.entity.Table;

import java.time.LocalDateTime;

/**
 * 消息实体
 */
@Data
@Table(name = "mms_message")
public class MessageEntity implements IEntity {
    @AssignID("snowid")
    private Long messageId;

    /**
     * 消息类型
     *
     * @see MessageTypeEnum
     */
    private Integer messageType;
    /**
     * 接收者类型
     *
     * @see UserTypeEnum
     */
    private Integer receiverUserType;

    /**
     * 接收者id
     */
    private Long receiverUserId;

    /**
     * 相关业务id
     */
    private String dataId;

    /**
     * 消息标题
     */
    private String title;

    /**
     * 消息内容
     */
    private String content;

    /**
     * 是否已读
     */
    private Integer readFlag;

    /**
     * 已读时间
     */
    private LocalDateTime readTime;

    @UpdateTime(FillStrategy.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @UpdateTime(FillStrategy.INSERT)
    private LocalDateTime createTime;
}
